/**
 * 
 */
package com.cqan.account.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.cqan.entity.pk.IdEntity;


/**
 * @Description TODO
 * @author SLATON
 * @date 2012-4-27下午6:15:38
 *
 */
@Entity
@SuppressWarnings("serial")
//表名与类名不相同时重新定义表名.
@Table(name = "DMS_PERMISSION")
//默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Permission  extends IdEntity{

	private String code;
	
	private boolean enabled;
	
	private String name;
	
	private Resource resource;
	
	
	@Column(name="CODE")
	public String getCode() {
		return code;
	}
	@Column(name="NAME")
	public String getName() {
		return name;
	}

	@ManyToOne 
    @JoinColumn(name = "REID") 
	public Resource getResource() {
		return resource;
	}

	@Column(name="ENABLED")
	public boolean isEnabled() {
		return enabled;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setResource(Resource resource) {
		this.resource = resource;
	}
	
	
}
